package cn.getech.data.development.constant;

import lombok.Getter;

@Getter
public enum ImportStepEnum {

    UPLOAD_ING(0 , "上传中" ),
    UPLOAD_ED(1 , "上传完成" ),
    CHECK_ING(2 , "检测中" ),
    CHECK_ED(3 , "检测完成" ),
    IMPORT_CONNECT_ING(4 , "导入数据源连接中" ),
    IMPORT_CONNECT_ED(5 , "数据源导入完成" ),
    IMPORT_TABLE_ING(6 , "导入仓库表中" ),
    IMPORT_TABLE_ED(7 , "导入仓库表完成" ),
    IMPORT_WORKFLOW_ING(8 , "导入工作流中" ),
    IMPORT_WORKFLOW_ED(9 , "导入工作流完成" );
    private  Integer id;
    private  String  name;
    ImportStepEnum(Integer id , String  name){
        this.id = id;
        this.name = name;
    }

    public static ImportStepEnum ObjOf(Integer status) {
        if (status == null) {
            return null;
        } else {
            for (ImportStepEnum s : ImportStepEnum.values()) {
                if (s.getId() == status) {
                    return s;
                }
            }
            return null;
        }
    }
}
